package io.gitee.hchaojie.day05;

import org.junit.Assert;
import org.junit.Test;

import java.util.ArrayList;

public class TestLinkedList {
    @Test
    public void test1() {
        // 原始类型
        // LinkedList list = new MyLinkedList();
        LinkedList<String> list = new MyLinkedList<>();

        list.add("abc");
        list.add("efg");

        Assert.assertEquals("abc", list.get(0));
        Assert.assertEquals("efg", list.get(1));

        try {
            list.get(-1);

            Assert.fail("没有抛异常。。。");
        } catch (Exception e) {
        }

        list.get(2);
        // Assert.assertEquals();

        Assert.assertEquals(2, list.size());
    }

    @Test
    public void test2() {
        LinkedList<Integer> list = new MyLinkedList<>();
        list.add(1);
        list.add(3);
    }
}
